package com.UI;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;




public class Friend_Item {
      private int layoutId;
      private int imageId;
      private String name;
      private LayoutInflater layoutInflater;
      private View view;
      private  ImageView icon; 
      private TextView nameView;
      private Button fightButton;
      private Button deleteButton;
      private String ID;
      public Friend_Item(Context context,int layoutId) {
		// TODO Auto-generated constructor stub
	   layoutInflater=LayoutInflater.from(context);
	   this.layoutId=layoutId;
      }
      public View getView() {
		  view=layoutInflater.inflate(layoutId, null);
    	  return  view;
	}
   
      public void setID(String ID) {
		this.ID=ID;
	}
      
      public String getID() {
        return ID;		
	}
      
      public void setLayoutId(int layoutId) {
		this.layoutId=layoutId;
	}
      
      
      public int getLayoutId() {
		return layoutId;
	}
      
      public void setNameText(String name) {
		this.name=name;
	}
      
     public void setIconImage(int icon) {
		imageId=icon;
	}
     
     public String getName() {
		return name;
	}
     
     public int getIconId() {
		return imageId;
	}
     
     public TextView getNameView() {
		nameView=(TextView)view.findViewById(R.id.friends_item_name);
    	 return nameView;
	}
     
     public ImageView getIcon() {
		icon=(ImageView)view.findViewById(R.id.friends_item_icon);
    	 return icon;
	}
    
     public Button  getFightButton() {
		fightButton=(Button)view.findViewById(R.id.friends_item_fight);
		fightButton.setVisibility(View.INVISIBLE);
		
    	 return fightButton;
	}
     
     public Button getDeleteButton() {
		deleteButton=(Button)view.findViewById(R.id.friends_item_delete);
		deleteButton.setVisibility(View.INVISIBLE);
		return deleteButton;
	}
     
     public void flingToLeft() {
		fightButton.setVisibility(View.VISIBLE);
	}
     
     public void flingToRight() {
		deleteButton.setVisibility(View.VISIBLE);
	}
}

